package com.moli.iov.admin.model.vo.req;

import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;

/**
 *
 * Validation for a real time report message.
 *
 * @author OAK
 * @version 3.0.1
 * @since 2019/12/10 16:05 PM.
 */
@Slf4j
@Data
public class RealtimeMessageQueryVo extends BaseVo implements Serializable {

  private static final long serialVersionUID = -4392845138453147699L;

  /**
   * Vehicle shelf.
   */
  private String vin;

  /**
   * Result status code: (1) success、 (2) failure.
   */
  private Integer result;

  /**
   * Begin time.
   */
  @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
  private Date beginTime;

  /**
   * End time.
   */
  @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
  private Date endTime;

  /*public void setBeginTime(Date beginTime) {
    try {
      if(beginTime == null){
        return;
      }
      String beginStr =
          DateUtil.format(DateUtil.YEAR_DAY, beginTime) + " 00:00:00";
      this.beginTime = DateUtil.parser(DateUtil.YEAR_SECOND, beginStr);
    } catch (ParseException e) {
      log.error("Begin time parse find a error", e);
    }
  }

  public void setEndTime(Date endTime) {
    try {
      if(endTime == null){
        return;
      }
      String endStr = DateUtil.format(DateUtil.YEAR_DAY, endTime) + " 23:59:59";
      this.endTime = DateUtil.parser(DateUtil.YEAR_SECOND, endStr);
    } catch (ParseException e) {
      log.error("End time parse find a error", e);
    }
  }*/
}
